<style type="text/css">
	.clearfix .select2-container{
		width: 100% !important;
	}
</style>
<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['系统配置','监控屏配置']" icon="fa fa-cog" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>监控屏配置</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<!--<div class="left page-header-btn">
								<button  type="button"  class="btn btn-primary" >添加</button>
							</div>-->
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="设备ID 屏幕名称 车牌号...">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>屏幕编号</th>
										<th>屏幕名称</th>
										<th>设备类型</th>
										<th>所属公司</th>
										<th>绑定车牌</th>
										<th>绑定时间</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" >
										<td>{{row.deviceId}}</td>
										<td>{{row.carNumber}}</td>
										<td>{{row.carType}}</td>
										<td>{{row.parentName}}</td>
										<td>{{row.bindCarNumber}}</td>
										<td>{{row.bindCarDate}}</td>
										<td>
											<button type="button" (click)="openConfigView(row,positionModal)" >配置</button>
											<button type="button" *ngIf='row.bindCarId' (click)="cencelBinding(row.deviceId)" >解除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	
	<!--弹窗部分-->
	<section bsModal #positionModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" (click)="closeConfigView(positionModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
						<h4 class="modal-title">重量映射配置</h4>
					</div>
					<div class="modal-body">
						<div class="row form-horizontal">
							<div class="form-group ">
								<label class="control-label col-sm-2">车 牌 号<sup>*</sup></label>
								<div class="col-sm-10">
									<div class="clearfix">
										<select class="select2 form-control" style="width: 100%" id="carNumberSelect2" name="bindCarNumber" [(ngModel)]='configRowParams.bindCarNumber' placeholder="">
											<option value=''></option>
											<!--<option *ngFor="let item of carList" [value]='item.value'>{{item.label}}</option>-->
										</select>
									</div>
								</div>
							</div>
							<!--<div class="form-group">
								<label class="control-label col-sm-2">车辆类型</label>
								<div class="col-sm-10">
									<div class="clearfix">
										<select class="form-control" name="carType"  style="width: 100%"  >
											<option  > 卡车</option>
											<option  > 汽车</option>
											<option  > 货车</option>
										</select>
									</div>
								</div>
							</div>
							
							<div class="form-group">
								<label class="control-label col-sm-2">更新频率</label>
								<div class="col-sm-10">
									<div class="clearfix">
										<input type="text"  class="form-control"  [(ngModel)]="configRowParams.lastUpdateUser"/>
									</div>
								</div>
							</div>
							
							<div class="form-group">
								<label class="control-label col-sm-2">核载重量</label>
								<div class="col-sm-10">
									<div class="clearfix">
										<input type="text"  class="form-control"  [(ngModel)]="configRowParams.faultTime"/>
									</div>
								</div>
							</div>-->
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" (click)="closeConfigView(positionModal)">取消</button>
						<button type="button" class="btn btn-primary" (click)="submitConfigMapped(positionModal)">确认</button>
					</div>
				</div>
			</div>
	</section>
</div>